Image encoding apparatus

ABSTRACT

When an input image and a sender information image independent from each other are combined into one transmission image in which the sender information image which has a lower line count (smaller area) is laid out in the upper portion while the input image having a greater area than the sender information image is laid out in the lower portion, both the input image and sender information image are individually rotated by 180 degrees before encoding, then the transmission image is encoded by JPEG from the input image side having a greater area.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a color facsimile machine using JPEGbased on ITU-T standards as its encoding system as well as relating to acontents distribution service having a color facsimile transmissionfunction.

2. Description of the Prior Art

In general, facsimile transmission has the advantage of urgently andrapidly transmitting and providing necessary information and in order tomake this advantage further useful, sender information that indicatesthe information source and when the information was provided is attachedto the sending original.

A facsimile machine using a sheet feed scanner and having no memory forstoring the whole image implements data transmission whilst reading theoriginal and creating its image data. Therefore, the sender informationis added before encoding then the image data and the sender informationare encoded integrally and sent.

There are some cases where image data should once be stored in thememory and the stored data should be sent some time later, such as casesfor predetermined time transmission, re-dialing transmission, contentsdistribution service and the like. Transmission of this type will becalled ‘memory transmission’. There are four ways of memory transmissionas follows:

(Method 1)

This method is implemented by first scanning the image data, storing itdirectly into the memory without coding(compressing), and adding thesender information to the image data when memory transmission isactually performed, then integrally encoding the image data with thesender information and transmitting it.

(Method 2)

This method is implemented by scanning the image data, encoding itbeforehand and storing the coded data into the memory, and decoding thecoded data stored in the memory to restore the original data when memorytransmission is actually started, then adding the sender information atthe head of the restored data and again encoding the integrated data andtransmitting it.

(Method 3)

This method is implemented by scanning the image data, adding the senderinformation to the scanned data immediately after scanning on thetransmission side, then compressing the total data into the memory andtransmitting it.

(Method 4)

This method is implemented by scanning image data, encoding itbeforehand and storing the coded data into the memory, and then alsoencoding the sender information when memory transmission is actuallystarted, then merging the two sets of coded data and transmitting it.

However, the above methods 1, 2 and 3 have the problems as follows:

The problem with Method 1: this method needs a high capacity memory fortemporarily storing uncompressed image data.

The problem with Method 2: this method takes long time for processingthe coding and decoding.

The problem with Method 3: the time of transmission, included in thesender information attached at the time of image scanning represents apast time, so that it is impossible to transmit the information of theexact time of transmission.

On the contrary, merging the coded data of the scanned image and codeddata of the sender information according to Method 4 can avoid the abovethree problems. However, the image data and the sender information arecoded independently, so that it is not possible to encode the image tobe transmitted second making the best use of the correlation with theimage to be transmitted first. Therefore, there are some limitations inencoding based on Method 4.

In connection with the above, mentioned as coding methods for monochrometransmission can be MH(Modified Huffman), MR(Modified Read),MMR(Modified Modified Read) and JBIG(Joint Bi-level Image Group).

MH is a coding scheme performed by coding run-lengths of ‘white’ runsand ‘black’ runs for each line by Huffman codes and adding a linesynchronizing signal EOL at the end of every one line of codes.

MR is an improved MH coding, in which data is coded by using thecorrelation with the previous line in order to enhance thecompressibility. That is, the first line is coded based on MH, the datafrom the second to K-th line is coded making use of the correlation withprevious lines. Then, the data on the (K+1)-th line is coded by MH, andthis cycle is repeated. This number ‘K’ is called the ‘K-parameter’. TheMR coding also uses the line synchronizing signal EOL.

Since MH uses independent data for each line and MR uses an independentline of data for every K lines, part of the image can be encoded anddecoded independently. Because these schemes are originally assumed tobe used for the lines without error correction, if a transmission erroroccurs, the decoded image only presents partial irregularities notaffecting the total image.

In contrast, because MMR is an encoding scheme having an infinite K(K=∞) and JBIG is a Markov model coding scheme, these schemes needreference pixels for encoding. Accordingly, it is impossible for MMR andJBIG to code and decode part of an image independently. Therefore, inthese coding schemes, the error correction mode(ECM) is essential.

As understood from the above description, of encoding schemes ofmonochrome transmission only MH and MR can realize memory transmissionwith sender information attached based on Method 4.

In the field of color facsimile technologies, JPEG(Photographic PictureExperts Group) has been adopted as a standard coding scheme. While forcolor facsimile, the coding scheme is the same as that of monochromefacsimile in terms of recommendations, hence JPEG is also one of codingscheme options. In JPEG, the DC component and AC components are coded inthe order mentioned. Since the DC component of a pixel block has astrong correlation with that of the previous pixel block, the differenceis used to encode. For countermeasures against transmission failure dueto image disturbance resulting from transmission error and for allowingrandom access, restart markers for initializing the DC component areprovided and can be used.

Also in JPEG, if data coding is effected by inserting a restart markerimmediately after the right end block of the image, the image can beseparated vertically into two parts, so that it becomes possible tomerge sets of coded data in the same manner as in the MH and MR schemesfor monochrome.

As understood from the above, attachment of sender information uponmemory transmission in color facsimile may be performed based on a JPEGscheme using restart markers. This has been disclosed in Japanese PatentApplication Laid-Open Hei 11 No.313210.

Attachment of sender information at the leading side of the image usingthe restart marker, however, presents the problem of lowering of theencoding efficiency. In order to clarify the reason of this problemoccurring, the JPEG algorithm and JPEG data format will be describedfirst.

A color image is composed of three components, each having tones, sothat the amount of data is bulky compared to that of a monochrome binaryimage of the same size. For example, a color image of 256 tones iscomposed of a data amount 24(=3×8) times as large as that of amonochrome binary image. Therefore, an efficient compression scheme isdesired for transmission.

JPEG which is most prevalent as a compression method for natural colorimages is used in many applications such as for digital cameras,personal computers, the internet, etc.

In the field of color facsimile, JPEG is used as the standard codingscheme though the CIELAB color space is used while other applicationsuse the YCbCr color space which permits linear transformation from theRGB space.

Further, as to facsimile transmission there are cases where the numberof lines or line count of the input image is unknown beforehand becausethe original is input through a sheet feed type scanner. Therefore, itis approved that the information of the line count may be put at the endof the compressed data.

JPEG is short for the Group ‘Joint Photographic Experts Group’, forjointly producing standards for coding still images, working on both ISOand CCITT(now ITU-T) standards. At present, however, it mainly indicatesthe coding scheme and coded file format defined by this group.

There are a number of JPEG algorithms. The one that is adopted for colorfacsimile is the same as that used in many other applications and iscalled the JPEG baseline algorithm.

FIG. 1 is a schematic diagram showing the coding and decoding schemebased on the JPEG baseline algorithm. Referring to next to FIG. 1, theJPEG baseline algorithm of coding and decoding and the functions of theblocks will be briefly described.

On the coding side 600, the original image data(CIELAB) 601 obtainedfrom an original image after color transformation is subjected tosubsampling at a subsampling portion 602. Then, each 8×8 block forluminance and chrominance is transformed by the DCT at a DCT portion603. Then, the DCT coefficients determined by the DCT portion 603 arequantized at a quantizer 604. Huffman codes are assigned to thequantized DC component and AC components at a Huffman encoder 605. Otherthan the compressed data, the JPEG data includes parameters required fordecoding such as information etc., for creating a quantization table T1and a Huffman table T2. Therefore, a control code adder 606 is providedto add the parameters of quantization table T1 and Huffman table T2having been used during data compression in quantizer 604 and Huffmanencoder 605, whereby JPEG data 607 to be transmitted is produced.

The data processing on the decoding side is basically performed byreverse operations of the coding. First, at a control code adder 606 b,necessary parameters such as quantization table T1, Huffman table T2 andthe like are extracted from JPEG data 607 so as to make a preparationfor decoding of the compressed data. Then, the compressed data issubjected to the Huffman decoding, inverse quantization, inverse DCT andinterpolation, on the basis of the parameters, through a Huffman decoder605 b, inverse quantizer 604 b, inverse DCT portion 603 b andinterpolation portion 608 in the order mentioned, whereby a decodedimage 601 b is obtained.

It should be noted that in JPEG, since some information losses will takeplace through quantization, the decoded image does not completely agreewith the original image. This kind of process is called irreversiblecoding.

Once the data based on JPEG is damaged, it is impossible to restore thedata. Therefore, ECM is essential for facsimile transmission andreception.

The reason subsampling is performed at subsampling portion 602 is thatthe human eye is insensitive to spatial variations in chrominancecompared to spatial variations in luminance. That is, only theresolution as to the chrominance is reduced by quality reduction whilethe resolution as to the luminance is left as is. Not only this processmakes the data be compressed but also provides an advantage of reducingthe amount of operations because of reduction in number of the blocks tobe subjected to the DCT process as described below.

In color facsimile, subsampling with a ratio of 4:1:1 of the chrominancedata a*, b* is basically performed by taking the average of four pixelsto reduce their vertical and horizontal resolutions to half. Therefore,four blocks of luminance data L* correspond to one block of luminancedata a* and one block of luminance data b*.

The DCT at DCT portion 603 is a kind of orthogonal transform. As shownin FIG. 2, output from one 8×8 block P(x,y) for one component of anoriginal image is one 8×8 DCT coefficient block F(u,v). The value at theupper left in a DCT coefficient block F(u,v), i.e., F(0,0) indicates itsDC component and other values in the block represent AC components.

The specific equation of the transformation in eight bit mode in theJPEG baseline algorithm is expressed as follows:

$\begin{matrix}{{{f\left( {x,y} \right)} = {{P\left( {x,y} \right)} - 128}}{{F\left( {u,v} \right)} = {\frac{1}{4}\left\{ {{C(u)}{C(v)}} \right\}{\sum\limits_{x = 0}^{7}{\sum\limits_{y = 0}^{7}\left\lbrack {{f\left( {x,y} \right)}\cos\;\left\{ \frac{\left( {{2x} + 1} \right)u\;\pi}{16} \right\}\;\cos\;\left\{ \frac{\left( {{2x} + 1} \right)v\;\pi}{16} \right\}} \right\rbrack}}}}\left( {u,v,x,{y = {0\mspace{14mu}{to}\mspace{14mu} 7}}} \right){{c(0)} = \frac{1}{\sqrt{2}}}{{c(n)} = {1\mspace{14mu}\left( {n \neq 0} \right)}}} & \text{(Formula~~1)}\end{matrix}$

The quantization at quantizer 604 is expressed as the following formula:G(u,v)=[F(u,v)/Q(u,v)](u, v=0 to 7)where F(u,v) represents the DCT coefficients before quantization, Q(u,v)represents quantization table T1 and G(u,v) represents the coefficientsafter quantization, and [ ] denotes rounding.

A different quantization table Q(u,v) may be used for each of the colorcomponents L*, a* and b*, but generally, for most cases, one table isused for luminance and another one for chrominance. Usually, for highfrequency components, the values in the table are made large so as toroughen the quantization. This can be justified because the human visualsensitivity becomes lower for the higher frequency components. That is,if the information of the higher frequency components is roughlyquantized, image degradation is hardly perceived. Nevertheless, sincethe image appearance depends on the image size, the viewpoint distance,the resolution and other factors, the optimal tables differ from oneanother depending upon the application used.

Upon code assignment of the DCT coefficients after quantization atHuffman encoder 605, since the DC component has a strong correlationwith that of the previous block, a Huffman code is assigned to itsdifference from that of the previous block, as shown in FIG. 3.

For the AC components, the values are detected by diagonally traversingscan in the zigzag order as shown in FIG. 4, coding is performed in thefollowing steps shown in the flowchart in FIG. 5.

-   (1) Scan the AC components in the zigzag order as shown in FIG. 4    (Step S1)-   (2) If the observed component is not equal to zero, perform grouping    (Steps S2 and S3)-   (3) If the observed component is equal to zero, count the run-length    (Steps S2 and S4)-   (4) If all the components scanned in the zigzag order are zero until    the end, stop the operation.

Since the higher frequency AC components after quantization are usuallydivided by greater values, most of the values will converge to zero.Therefore, the amount of codes can be markedly reduced by the procedures(3) and (4).

Since the optimal Huffman coding differs depending upon the image andquantization table T1 used, the Huffman table T2 is allowed to beselected in JPEG (Step S5).

Now that the JPEG algorithm has been described, in order to positivelydecode the coded data under different circumstances, it is necessary tosend various parameters in the common format in addition to thecompressed data thus produced based on the coding algorithm. This is whythe exchange format of coded data is specified in the JPEG standard.Next, the data structure of the exchange format of JPEG data will bedescribed with reference to FIG. 6.

It is assumed for convenience sake that JPEG data is roughly dividedinto three parts, namely leading marker code portion TM, imageinformation portion II and the end marker code portion EM.

Leading marker code portion TM necessarily starts with a SOI area,followed by an area for marker group M including various parameters fordecoding.

The marker group M includes marker segments APP1, COM, DHT, DQT, SOF0,DRI and SOS.

The marker segment APP1 is introduced for color facsimile and contains afacsimile identifier and resolution information.

The marker segment COM holds comments such as a product name etc.,having no effect on compression.

The marker segment DHT includes the information for generating Huffmantable T2 and the marker segment DQT includes quantization table T1.

The marker segment SOF0 is the frame header for JPEG baseline andincludes the line count in the image and the image width.

The marker segment SOS should be located immediately before compressiondata while the marker segments SOF0, DHT and DQT may be positioned atany place between the area SOI and marker segment SOS. As to markersegments DHT and DQT, all tables may be included in a single markersegment, or a multiple number of marker segments may be used eachincluding one table only. The information as to assignment of the tablesto different color components is included in the marker segment SOS.

The marker segment DRI stores the value of a restart interval whichdesignates the interval between after mentioned restart markers RM.These will be described later.

The end marker code portion EM(FIG. 6) is comprised of marker segmentsDNL and EOI.

The marker segment DNL holds an NL parameter which designates the linecount.

The DNL is provided assuming a case where the encoding side has nomemory for storing the entire image and cannot determine the line countat the time of coding. That is, this marker segment is used to designatethe line count in the image after compression. In this case, the linecount stored in the marker segment SOF0 is a dummy line count, and theNL parameter of marker segment DNL indicates the true line count. Here,the relation: the line count Y>NL or Y=0 should hold.

For color facsimile data, JPEG data with the line count designated bymarker segment DNL must be decoded. Use of the marker segment DNL isdefined in the JPEG standard but is not found in other applications butbeing unique to facsimile data.

The image information portion II is comprised of compressed dataportions CD and restart markers RM as shown in FIG. 6. In the JPEGalgorithm, one unit of one color component is encoded then another unitof a next color component is encoded. The cyclic unit is called a MCU.For the case of the 4:1:1 subsampling, four blocks of the luminancecomponent and one block for each of the two components of chrominanceform one MCU.

It is ruled in the JPEG standard that if restart markers RM are used,they must be interposed at every boundary between MCUs. This interval iscalled the restart interval and is designated by the marker segmentDRI(FIG. 7) in the leading marker code portion TM.

For color facsimile communication, while the JPEG algorithm describedheretofore is adopted as the standard coding scheme, use of restartmarkers RM upon attachment of sender information after encoding inmemory transmission has the following problems.

Since the DC component value corresponds to the total value of thepixels in the block, it varies depending on the location in the imagebut the differential values between DC components inherently converge toaround zero. Therefore, it is possible to improve the encodingefficiency by allotting short codes to small differential values.

However, code assignment immediately after restart markers RM is madenot to the differential values between DC components but to the DCcomponents themselves. Therefore, the more the restart markers RM are,the more the encoding efficiency decreases.

Text for the sender information can be represented with about 32 linesat 200 dpi. Since one block has 8×8 pixels, 1 MCU is made up of 16×16pixels in a 4:1:1 subsampling configuration. The sender informationattached to an A4 sized image having a width of 1728 pixels isconstituted by 216(1728/16*32/16) MCUs. Therefore, to add the senderinformation after coding, the interval at which restart markers RM areinserted should be set at 216 MCUs.

However, the interval between restart markers RM cannot be variedaccording to the JPEG standard. Therefore, if the sender information isadded at the leading side of the image, a number of restart markers RMmust be inserted within the image data at intervals of the samedistance, even though all of them but one, which should be inserted atthe connection where the sender information and the image are merged,are not actually needed.

As a result, compressed data CD is forced to be divided by restartmarkers into rectangular blocks of 32 lines the way the senderinformation 4 is defined. FIG. 8 shows the relationship between the JPEGdata and the image. FIG. 8( a) is an example image of an original image1 added with a sender information 4 arranged at its leading end. FIG. 8(b) is a schematic diagram showing the relationship of JPEG data withblocks of image divided by the lines in the image in (a). A referencenumeral C1 designates a piece of compressed data corresponding to oneblock in original image 1 and C4 designates the compressed data ofsender information 4.

Since restart marker RM initializes the DC component, correlationbetween DC components can be used less as the restart markers increasein number, posing the problem of the encoding efficiency being lowered.Since an A4 sized image is about 2300 lines in height, about 71(=2300/32) restart markers are inserted in a page of image, resulting amarked degradation of encoding efficiency.

SUMMARY OF THE INVENTION

The present invention has been achieved to eliminate the above problem,it is therefore an object of the present invention to provide an imageencoding apparatus in which the encoding efficiency is improved byavoiding an increase in number of restart markers when senderinformation is added at the leading side of an image.

In order to achieve the above object, the present invention isconfigured as follows:

In accordance with the first aspect of the present invention, an imageencoding apparatus which sends a single transmission image by firstcoding a first image and a second image having a smaller area than thefirst image and combining them, with the second image arranged in theupper side of the first image in the single transmission image,includes:

an image rotating portion for rotating each of the first and secondimages by approximately 180 degrees and outputting the first and secondrotated images;

an encoder portion for generating the first set of codes correspondingto the first rotated image and the second set of codes corresponding tothe second rotated image, based on the coding block unit determineddepending on the size of the first rotated image; and

a code merging portion for combining the second set of codes after thefirst set of codes.

According to the above first aspect of the present invention, since theimage rotating portion rotates the transmission image by approximately180 degrees, i.e., by the angle which will not produce any image loss ofthe output of the transmission image, the encoding can be implemented inthe reverse direction so that the first image is encoded first previousto the second image. This configuration allows the encoder portion toimplement encoding of the first and second rotated images, based on thecoding block unit determined depending on the size of the first rotatedimage. Here, since the second rotated image is smaller than the firstrotated image, the second rotated image will not be divided intomultiple coding blocks. That is, the combined image of the first andsecond rotated images can be encoded by processing two blocks only, sothat it is possible to reduce the implementations of resetting datacompression etc., for every coding block to a minimum frequency andhence improve the encoding efficiency.

In accordance with the second aspect of the present invention, the imageencoding apparatus having the above first feature is characterized inthat the encoder portion determines the interval at which identificationcodes indicating coding block units are inserted, based on the size ofthe first rotated image.

According to the above second aspect of the present invention, since theinterval at which identification codes indicating the boundaries betweencoding block units are inserted is determined based on the size of thefirst rotated image, no identification code will be inserted into thecodes of the second rotated image which is smaller than the first image.Therefore, it is possible to improve the encoding efficiency.

In accordance with the third aspect of the present invention, the imageencoding apparatus having the above first feature is characterized inthat the code merging portion combines the first set of codes and thesecond set of codes with reference to the identification code indicatingthe boundary between coding block units.

In accordance with the fourth aspect of the present invention, the imageencoding apparatus having the above first feature is characterized inthat the encoder portion generates codes for a dummy image after theidentification code indicating the boundary between coding block unitswhen the first rotated image is encoded, and the codes for a dummy imagecan be replaced with the codes of the second rotated image.

In accordance with the fifth aspect of the present invention, the imageencoding apparatus having the above first feature is characterized inthat upon encoding, the encoder portion generates a line countdefinition parameter at the position before, and a line countredefinition parameter at the position after, the subject codes as theencoding target, assigns a dummy value as the line count definitionparameter for the first set of codes, and assigns the line count of themerged image information of the first and second rotated imageinformation as the line count redefinition parameter for the second setof codes.

In accordance with the sixth aspect of the present invention, the imageencoding apparatus having the above first feature is characterized inthat upon encoding, the encoder portion generates a line countdefinition parameter at the position before, and a line countredefinition parameter at the position after, the subject codes as theencoding target, assigns the line count of the merged image informationof the first and second rotated image information as the line countdefinition parameter for the first set of codes, and assigns the linecount of the first rotated image information as the line countredefinition parameter for the first set of codes.

According to the above third to sixth aspects of the present invention,it is possible to positively combine the first and second sets of codes.

In accordance with the seventh aspect of the present invention, theimage encoding apparatus having the above first feature is characterizedin that the second image is an image of sender information representedin a bitmap form.

According to the above seventh aspect of the present invention, sincethe second image, i.e., sender information widely used for facsimileetc., made up of text, numerals, symbols and codes etc., can be laid outwith a normal orientation in the upper part of the first image, thisconfiguration provides for the receiver transmission images witheasy-to-recognize sender information attached thereto.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an overall block diagram for illustrating JPEG coding anddecoding;

FIG. 2 is an illustrative view showing the DCT;

FIG. 3 is an illustrative view showing a method of coding DC components;

FIG. 4 is an illustrative view showing zigzag scanning;

FIG. 5 is a block diagram for illustrating a method of coding ACcomponents;

FIG. 6 is an illustrative view showing an exchange format of JPEG data;

FIG. 7 is an illustrative view showing specific marker segmentscontained in a marker group;

FIG. 8 is an illustrative view showing the relationship between an imageto be transmitted and its transmission data in a conventional imageencoding apparatus;

FIG. 9 is a block diagram showing an overall configuration of an imageencoding apparatus in accordance with the embodiment of the presentinvention;

FIG. 10 is a diagram for explaining the manner of coding and codemerging in accordance with example 1 of the present invention;

FIG. 11 is a diagram for explaining the manner of coding and codemerging in accordance with example 2 of the present invention;

FIG. 12 is a diagram for explaining the manner of coding and codemerging in accordance with example 3 of the present invention; and

FIG. 13 is an illustrative view showing an inverted image with itstransmission data in accordance with the embodiment of the presentinvention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The embodiment of the present invention will hereinafter be described indetail with reference to the accompanying drawings. The same parts asthose described above are allotted with the same reference numerals andthe description is omitted.

FIG. 9 is a block diagram showing an overall configuration of an encoderportion in an image encoding apparatus in accordance with the embodimentof the present invention.

The image encoding apparatus in accordance with the embodiment of thepresent invention includes: an image input portion 2 for inputting anoriginal image 1 to be transmitted; a sender information generator 3 forgenerating a sender information image 4 bitmapped based on the senderinformation; a image rotating portion 5 for rotating the input image by180 degrees and outputting the rotated image; an image memory 7 fortemporarily storing the image output from image rotating portion 5; anencoder portion 9 for encoding the rotated image; a pair of codememories 10 and 11 for storing the coded data from encoder portion 9;and a code merging portion 13 for merging a pair of sets of coded data.

Reference numerals 1 and 6 in FIG. 9 designate schematic drawingsshowing an image 1 to be transmitted and its rotated image 6. Referencenumerals 4 and 8 designate schematic drawings showing a senderinformation image 4 bitmapped from sender information and its rotatedsender information image 8. A reference numeral 12 designates aschematic drawing showing a transmission image 12 which is created bymerging the pieces of coded data. When the transmitted data is decodedand printed, this drawing is reproduced. The broken lines in FIG. 9indicate correspondence between the drawings and image data or codedata.

Image input portion 2 generates image data to be transmitted, bycreating digital image data by scanning a document with a printed imagethereon using an unillustrated scanner, or by processing existingdigital image data.

Sender information generator 3 creates a bitmap representation of thesender information such as the sender name, time of transmission etc.,represented in a certain font to generate image data 4.

Image rotating portion 5 rotates the input image data by 180 degrees.That is, this rotates the image data output from image input portion 2and the image data 4 output from sender information generator 3 by 180degrees or reverses the direction of coding and outputs it to imagememory 7.

In the description of the embodiment, the angle of rotation is set at180 degrees, but the angle of rotation may be set at any value whichapproximately inverts the orientation of the input image data. That is,any angle of rotation may be permitted as long as the output of theentire transmission image has not been lost when the image data afterrotation is decoded. The angle of rotation which will not cause any lossof the image data will be referred to as ‘approximately 180 degrees’.Therefore, approximately 180 degrees may differ depending on the size,layout and other factors of the transmission image with respect to theoutput paper.

Image memory 7 stores the rotated image, obtained by rotating inputimage 1 by 180 degrees, and encoder portion 9 encodes this 180 degreerotated image.

Code memories 10 and 11 store the rotated and encoded image data and therotated and encoded image data of the sender information, respectively.

Image merging portion 13 merges two pieces of coded data and outputs theresult to communication line 14.

There are several methods of coding through encoder portion 9 andmerging the coded data through image merging portion 13, of which commonfeatures are described as follows:

-   (a) Concerning the Image Size

The number of lines or line count for an input image, represented by Y1and the line count for a sender information, represented by H, should bespecified to be at multiples of 16 when 4:4:1 subsampling is implementedand at multiples of 8 when 1:1:1 subsampling is implemented.

-   (b) Concerning the Restart Interval

The value of the restart interval stored in the marker segment DRI (FIG.7) is determined depending on the image width X and the line count Y1.That is, when 4:1:1 subsampling is implemented, the interval is set tobe (X/16)×(Y1/16). When 1:1:1 subsampling is implemented, the intervalis set to be (X/8)×(Y1/8).

Next, the methods of coding and merging the coded data will be describedwith reference to examples 1 to 3.

EXAMPLE 1

The first method in example 1 of coding and merging the coded data isimplemented by stuffing the image data with dummy data, encoding theentire data, then replacing the dummy data with the coded data of thesender information. This will be described in detail with reference toFIG. 10.

Concerning the encoding of input image 1, the Y parameter (the linecount) of the marker segment SOF0(see FIG. 7) in the leading marker codeportion TM is set to be the actual line count Y1+H while dummy data DDhaving H lines equal to those of sender information image 4 is attachedunder the rotated input image 6. The thus generated image is totallyencoded based on JPEG.

Restart marker RM is inserted between the compressed data C6 for therotated input image 6 and the compressed data CDD for the dummy data DD,following the restart interval value described in the marker segmentDRI(see FIG. 7). The coded data is stored into code memory 10.

The rotated sender information image 8 is encoded separately from therotated input image 6, based on JPEG and is stored into code memory 11.

Upon transmission, the leading marker code portion TM of the coded data,the compressed data C6 corresponding to rotated input image 6 and therestart marker RM, all stored in code memory 10 are transmitted,thereafter the compressed data C8 for rotated sender information image 8and the end marker code portion EM are transmitted.

Resultantly, the transmitted codes become correspondent to a singletransmission image 12 attached with rotated sender information image 8and provide the same image when decoded.

EXAMPLE 2

The second method in example 2 of coding and merging the coded data isimplemented by putting a dummy value of the line count (Y0) as the Yparameter and setting the true line count into the marker segmentDNL(see FIG. 6) of the end marker code portion EM when the image data ismerged with rotated sender information image 8. This will be describedin detail with reference to FIG. 11.

Concerning the encoding of input image 1, the Y parameter of the markersegment SOF0(see FIG. 7) in the leading marker code portion TM is setwith a dummy image line count Y0 for the image. Here, Y0 should be Y0=0or Y0>Y1+H.

In this case, only the rotated input image 6 with no dummy data DD(FIG.10) shown in example 1 above, is encoded based on JPEG. Based on therestart interval set in the marker segment DRI(see FIG. 7), restartmarker RM is placed after the compressed data C6, and the end markercode portion EM is placed after the marker. A marker segment DNL is putin the end code portion EM and the parameter NL is set at Y1(the trueline count).

The rotated sender information image 8 is encoded separately from therotated input image 6, based on JPEG and is stored into code memory 11.Here, the parameter Y in the marker segment SOF0 of the leading markercode portion TM is set equal to H (Y=H) and the parameter NL of themarker segment DNL of end code portion EM is set equal to Y1+H(NL=Y1+H).

Upon transmission, the leading marker code portion TM of the coded data,the compressed data C6 corresponding to rotated input image 6 and therestart marker RM, all stored in code memory 10 are transmitted,thereafter the compressed data C8 for rotated sender information image 8and the end marker code portion EM are transmitted.

EXAMPLE 3

The third example of a method of coding and merging the coded data isimplemented by setting the true line count of the image to betransmitted as the Y parameter and providing a DNL which designates thetrue line count in the image when no sender information image isattached. This will be described in detail with reference to FIG. 12.

Concerning the encoding of input image 1, the Y parameter of the markersegment SOF0(see FIG. 7) in the leading marker segment code portion TMis set with the actual line count (Y1+H) in the image. In this case,instead of using dummy data, a marker segment DNL is assigned in the endmarker code portion EM, and NL is set equal to Y1(NL=Y1) so that onlythe rotated input image 6 is encoded based on JPEG.

Based on the restart interval designated in the marker segment DRI,restart marker RM is placed after the compressed data C6 of rotatedinput image 6, and the end marker code portion EM is placed after themarker. A marker segment DNL is put in the end marker code portion EMand the parameter NL is set at Y1(NL=Y1).

The 180 degree rotated sender information, image 8, is encodedseparately from the rotated input image 6, and is stored into codememory 11.

Upon transmission, the leading marker code portion TM of the coded data,the compressed data C6 corresponding to rotated input image 6 and therestart marker RM, all stored in code memory 10 are transmitted,thereafter the compressed data C8 for rotated sender information image 8and the end marker code portion EM are transmitted.

In the above three methods, the methods and means of examples 1 and 3cannot be used unless the line count in the image to be transmitted isknown before encoding the rotated sender information image 8. On theother hand, the method and means of example 2 can be used even if theline count H of rotated sender information image 8 becomes definite atlast just before transmission. With any of the above methods, the codesstored in code memory 10, though they lack the code data C8 of rotatedsender information image 8, can be decoded into a normal image.

Therefore, if the codes stored in code memory 10 are transmitted, thecodes without data of sender information data image 8 can also betransmitted.

In connection with the above, it should be noted that for the case ofexample 2 there is a risk that the codes of rotated sender informationimage 8 stored in code memory 11 might be unable to be decoded correctlybecause Y<NL.

With any of the above first to third methods, the codes transmitted asillustrated in FIGS. 9 and 13 represent a single transmission image 12including rotated sender information image 8 therein and can produce theimage when decoded. In any of the above methods, only one restart markerRM is used.

As has been described heretofore, when an input image 1 and senderinformation image 4, independent from each other, are combined to createa single transmission image and if the sender information image 4 of alower line count (small area) and the input image 1 having a larger areathan the sender information image 4 are arranged above and below eachother in the transmission image, the input image 1 and senderinformation image 4 may be individually rotated by 180 degrees beforeencoding so that the JPEG encoding can be started from the larger areaor from the input image 1 side. With this scheme, the coding block unitcan be determined based on the input image 1, whereby it is possible tocombine two sets of codes by only inserting a single restart marker RMbetween the codes of rotated input image 6 and those of rotated senderinformation image 8.

On the contrary, if input image 1 and sender information image 4 areencoded without being rotated 180 degrees before encoding, the codingblock unit is determined based on the area of sender information image 4having a lower line count, so that many restart markers RM should beincluded in the codes of input image 1 having a larger area.

Accordingly, in accordance with the image encoding apparatus of theembodiment described above, no restart marker will be included duringencoding of input image 1, thus enhancing the encoding efficiency.

As has been described heretofore, according to the aspect of the presentinvention, when a secondary image such as sender information, forexample, needs to be attached to the subject image when memorytransmission is implemented, the first image having a large area can beencoded as a single coding block. Therefore, it is possible to combinethe two images by inserting only one restart marker, which functions asan identification code attached to JPEG codes to be transmitted, betweenthe first set of codes and the second sets of codes. As a result, amarked improvement of the encoding efficiency can be achieved comparedto the conventional technique wherein many restart markers are needed.

Also, for color facsimile, color ink-jet printers are often used withplain paper. Therefore, the image is printed on a cut sheet, so that itis not unnatural if inverted images are transmitted because the user maysimply turn the paper upside down. Further, since the paper generallycomes out from the front of the printer toward the user, the paper withprinted images thereon can be discharged with a normal orientation,which is an advantage for the user.

1. An image encoding apparatus which sends a single transmission imageby first coding a first image and a second image having a smaller areathan the first image and combining them, with the second image arrangedin the upper side of the first image in the single transmission image,comprising: an image rotating portion for rotating each of the first andsecond images by approximately 180 degrees and outputting the first andsecond rotated images; an encoder portion for generating a first set ofcodes corresponding to the first rotated image and a second set of codescorresponding to the second rotated image, in a coding block unitdetermined by inserting an identification code at a positioncorresponding to the size of the first rotated image; and a code mergingportion for combining the second set of codes after the first set ofcodes.
 2. The image encoding apparatus according to claim 1, wherein theencoder portion determines an interval at which identification codesindicating coding block units are inserted, based on the size of thefirst rotated image.
 3. The image encoding apparatus according to claim1, wherein the code merging portion combines the first set of codes andthe second set of codes with reference to the identification codeindicating the boundary between coding block units.
 4. The imageencoding apparatus according to claim 1, wherein the encoder portiongenerates codes for a dummy image after the identification codeindicating the boundary between coding block units when the firstrotated image is encoded, and the codes for a dummy image can a replacedwith the codes of the second rotated image.
 5. The image encodingapparatus according to claim 1, wherein upon encoding, the encoderportion generates a line count definition parameter at the positionbefore, and a line count redefinition parameter at the position after,the subject codes as the encoding target, assigns a dummy value as theline count definition parameter for the first set of codes, and assignsthe line count of the merged image information of the first and secondrotated image information as the line count redefinition parameter forthe second set of codes.
 6. The image encoding apparatus according toclaim 1, wherein upon encoding, the encode portion generates a linecount definition parameter at the position before, and a line countredefinition parameter at the position after, the subject codes as theencoding target, assigns the line count of the merged image informationof the first and second rotated image information as the line countdefinition parameter for the first set of codes, and assigns the linecount of the first rotated image information as the line countredefinition parameter for the first set of codes.
 7. The image encodingapparatus according to claim 1, wherein the second image is an image ofsender information represented in a bitmap form.